<%@ Page Language="C#" MasterPageFile="~/IPMSMasterPage.master" AutoEventWireup="true" 
CodeFile="OptProduct.aspx.cs" Inherits="OptProduct" title="Project Monitoring System" 
culture="auto:en-US" uiculture="auto" maintainscrollpositiononpostback="true" 
meta:resourcekey="PageResource1" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server" Visible="false">
</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtSearchCreateDateBegin"
    Enabled="True" Format="yyyy-MM-dd">
</cc1:CalendarExtender>
<cc1:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtSearchCreateDateEnd"
    Enabled="True" Format="yyyy-MM-dd">
</cc1:CalendarExtender>
<div style="margin-left:10px;margin-right:10px;">
    <asp:Panel ID="panelSearch" runat="server">
        <fieldset>
            <legend>
                <asp:Label ID="lblSearch" runat="server" Text="Search" meta:resourcekey="lblSearchResource1"></asp:Label>
            </legend>
            <table>
                <tr>
                    <td width="60" align="left">
                        <asp:Label ID="lblSearchModel" runat="server" Text="Model No." meta:resourcekey="lblSearchModelResource1"></asp:Label>
                    </td>
                    <td width="200" align="left">
                        <asp:TextBox ID="txtSearchModel" runat="server"></asp:TextBox>
                    </td>
                    <td width="100" align="left">
                        <asp:Label ID="lblSearchModelName" runat="server" Text="Model Name" meta:resourcekey="lblSearchModelNameResource1"></asp:Label>
                    </td>
                    <td width="200" align="left">
                        <asp:TextBox ID="txtSearchModelName" runat="server"></asp:TextBox>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="lblSearchSpecification" runat="server" Text="Specification" meta:resourcekey="lblSearchSpecificationResource1"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtSearchSpecification" runat="server"></asp:TextBox>
                    </td>
                    <td align="left">
                        <asp:Label ID="lblSearchCreateDate" runat="server" Text="Create Date" meta:resourcekey="lblSearchCreateDatePersonResource1"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtSearchCreateDateBegin" runat="server"></asp:TextBox>To
                        <asp:TextBox ID="txtSearchCreateDateEnd" runat="server"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Button ID="btnSearch" runat="server" CssClass="submit" Text="Search" CausesValidation="false" meta:resourcekey="btnSearchResource1" onclick="btnSearch_Click"/>
                        <asp:Button ID="btnNewProduct" runat="server" CausesValidation="False" CssClass="submit" Text="New Product" meta:resourcekey="btnNewProductResource1" onclick="btnNewProduct_Click"/>
                   </td>         
                </tr>
            </table>
        </fieldset>
    </asp:Panel>
    <table width="100%">
        <tr>
            <td align="center" width="100%">
                <asp:Label ID="lblError" runat="server" ForeColor="Red" Width="100%" CssClass="error" meta:resourcekey="lblErrorResource1"></asp:Label>
            </td>
        </tr>
    </table>
    <asp:Panel ID="panelActive" runat="server" meta:resourcekey="ActivePanelResource1">
        <fieldset>
            <legend>
                <asp:Label ID="lblActive" runat="server" Text="Active Products" meta:resourcekey="lblActiveResource1"></asp:Label>
            </legend>
            <table>
                <tr>
                    <td>
                        <asp:GridView CssClass="Grid" ID="gvActive" runat="server" 
                            BackColor="#DEBA84" BorderColor="#660000"
                            BorderStyle="Solid" BorderWidth="1px" CellPadding="0" CellSpacing="0" Width="100%"
                            Height="1%" AllowPaging="True" PageSize="10" AllowSorting="True" 
                            EmptyDataText="No Product Record Aavailable!"
                            AutoGenerateColumns="False" meta:resourcekey="gvActiveResource1" 
                            DataKeyNames="Model"
                            onpageindexchanging="gvActive_PageIndexChanging" 
                            onrowcommand="gvActive_RowCommand">
                            <Columns>
                                <asp:TemplateField HeaderText="Model No." ItemStyle-Width="100" ItemStyle-HorizontalAlign="center" meta:resourcekey="BoundFieldResource1">
                                    <ItemTemplate>
                                        <a href="OptProductProjects.aspx?Model=<%# Eval("Model")%>&ModelName=<%# Eval("ModelName")%>">
                                            <%# Eval("Model")%>
                                        </a>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <%--<asp:BoundField DataField="Model" HeaderText="Model No." HeaderStyle-Width="100" ItemStyle-HorizontalAlign="left" ItemStyle-Wrap="false" meta:resourcekey="BoundFieldResource1"/>--%>
                                <asp:BoundField DataField="ModelName" HeaderText="Model Name" HeaderStyle-Width="100"  ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource2"/>
                                <asp:BoundField DataField="Revision" HeaderText="Revision" HeaderStyle-Width="100" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource3"/>
                                <asp:BoundField DataField="Specification" HeaderText="Specification" HeaderStyle-Width="150" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource4"/>
                                <asp:BoundField DataField="CreateDate" HeaderText="Create Date" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource5"/>
                                <asp:BoundField DataField="UpdateIP" HeaderText="IP Address" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource6"/>
                                <asp:BoundField DataField="UpdateBy" HeaderText="Updated By" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource7"/>
                                <asp:BoundField DataField="UpdateDate" HeaderText="Last Update Date" HeaderStyle-Width="200" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource8"/>
                                <asp:TemplateField HeaderText="" ItemStyle-Width="60" ItemStyle-HorizontalAlign="center">
                                    <ItemTemplate>
                                        <a href="OptProductUpdate.aspx?Model=<%# Eval("Model")%>"><img src="Images/icon-edit.gif" border="0" /></a>
                                        <asp:ImageButton ID="imgBtnDelete" CommandName="halfDelete" OnClientClick="javascript:return confirm('Do you want to delete the record?');" runat="server" ImageUrl="Images/icon-delete.jpg"/>
                                    </ItemTemplate>
                                </asp:TemplateField>
                           </Columns>
                            <HeaderStyle CssClass="GridHeaderStyle"/>
                            <RowStyle CssClass="GridRowStyle" />
                            <AlternatingRowStyle CssClass="GridAltRowStyle" />
                            <SelectedRowStyle CssClass="GridSelectedRowStyle" />
                            <PagerStyle CssClass="GridPagerStyle" ForeColor="White" />
                            <FooterStyle CssClass="GridFooterStyle" />
                        </asp:GridView>
                    </td>
                </tr>
            </table>
        </fieldset>
    </asp:Panel>
    <asp:Panel ID="panelDeleted" runat="server" meta:resourcekey="ActivePanelResource1">
        <fieldset>
        <legend>
            <asp:Label ID="lblDeleted" runat="server" Text="Deleted Products" meta:resourcekey="lblDeletedResource1"></asp:Label>
        </legend>
        <table>
            <tr>
                <td>
                    <asp:GridView CssClass="Grid" ID="gvDeleted" runat="server" 
                        BackColor="#DEBA84" BorderColor="#660000"
                        BorderStyle="Solid" BorderWidth="1px" CellPadding="0" CellSpacing="0" Width="100%"
                        Height="1%" AllowPaging="True" PageSize="10" AllowSorting="True" 
                        EmptyDataText="No Deleted Product Record Available!"
                        AutoGenerateColumns="False" meta:resourcekey="gvActiveResource1" 
                        onpageindexchanging="gvDeleted_PageIndexChanging"
                        DataKeyNames="Model"
                        onrowcommand="gvDeleted_RowCommand">
                        <Columns>
                            <asp:BoundField DataField="Model" HeaderText="Model No." HeaderStyle-Width="100" ItemStyle-HorizontalAlign="left" ItemStyle-Wrap="false" meta:resourcekey="BoundFieldResource9"/>
                            <asp:BoundField DataField="ModelName" HeaderText="Model Name" HeaderStyle-Width="100"  ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource10"/>
                            <asp:BoundField DataField="Revision" HeaderText="Revision" HeaderStyle-Width="100" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource11"/>
                            <asp:BoundField DataField="Specification" HeaderText="Specification" HeaderStyle-Width="150" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource12"/>
                            <asp:BoundField DataField="CreateDate" HeaderText="Create Date" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource13"/>
                            <asp:BoundField DataField="DeleteIP" HeaderText="IP Address" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource14"/>
                            <asp:BoundField DataField="DeleteBy" HeaderText="Deleted By" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource15"/>
                            <asp:BoundField DataField="DeleteDate" HeaderText="Delete Date" HeaderStyle-Width="200"  ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource16"/>
                            <asp:TemplateField ItemStyle-Width="60" ItemStyle-HorizontalAlign="center" HeaderText="">
                                <ItemTemplate>
                                    <asp:ImageButton ID="lbtnRestore" CommandName="Restore" runat="server" ImageUrl="Images/icon-restore.jpg"/>
                                    <asp:ImageButton ID="lbtnFroceDelete" CommandName="ForceDelete" OnClientClick="javascript:return confirm('Do you want to delete the record?');" runat="server" ImageUrl="Images/icon-trash.gif"/>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <HeaderStyle CssClass="GridHeaderStyle"/>
                        <RowStyle CssClass="GridRowStyle" />
                        <AlternatingRowStyle CssClass="GridAltRowStyle" />
                        <SelectedRowStyle CssClass="GridSelectedRowStyle" />
                        <PagerStyle CssClass="GridPagerStyle" ForeColor="White" />
                        <FooterStyle CssClass="GridFooterStyle" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
        </fieldset>
    </asp:Panel>
</div>
</asp:Content>

